home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Programming / tek / mem / mmuallochandle0.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-05-12  |  520 b   |  30 lines

  1.  
  2. #include "tek/mem.h"
  3.  
  4. /* 
  5. **    TEKlib
  6. **    (C) 2001 TEK neoscientists
  7. **    all rights reserved.
  8. **
  9. **    TAPTR TMMUAllocHandle0(TAPTR mmu, TDESTROYFUNC destroyfunc, TUINT size)
  10. **
  11. **    allocate a generic handle with destructor,
  12. **    and zero out the entire allocation
  13. **
  14. */
  15.  
  16. TAPTR TMMUAllocHandle0(TAPTR mmu, TDESTROYFUNC destroyfunc, TUINT size)
  17. {
  18.     if (size)
  19.     {
  20.         THNDL *handle = TMMUAlloc0(mmu, size);
  21.         if (handle)
  22.         {
  23.             handle->destroyfunc = destroyfunc;
  24.             handle->mmu = mmu;
  25.             return (TAPTR) handle;
  26.         }
  27.     }
  28.     return TNULL;
  29. }
  30.